﻿' ------------------------------------------------------------------------------
' A simple implementation of a few Assert predicates.
' ------------------------------------------------------------------------------
' This file is part of the SQL Server 2008 Technology Demonstration. This
' application was designed and coded by Eric Weitzman, LandTime Inc, for
' Microsoft Corporation. Contact Ed Katibah at Microsoft about this demo.
' Copyright © 2008 Microsoft Corporation. All rights reserved.
' ------------------------------------------------------------------------------

Friend Module Assertion
    Public Sub Assert(ByVal val As Boolean, ByVal msg As String)
        If val Then Return
        Throw New ApplicationException("ASSERTION FAILED: " & msg)
    End Sub

    Public Sub AssertFail(ByVal msg As String)
        Assert(False, msg)
    End Sub

    Public Sub AssertNotReached(ByVal msg As String)
        Throw New ApplicationException("ASSERT NOT REACHED FAILED: " & msg)
    End Sub
End Module
